<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/icon.css">
    <script type="text/javascript" src="/static/plugins/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/easyui/jquery.easyui.min.js"></script>
    <!--引入中文包-->
    <script type="text/javascript" src="/static/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/static/js/index.js"></script>

    <script type="text/javascript" src="/static/js/member.js"></script>
</head>

<body>
    <form id="info_form" method="post">
        <table>
            <tbody>
                <tr>
                    <td>
                        <div class="panel panel-htop" style="display: block; width: 250px;"><div id="p" class="easyui-panel panel-body panel-body-noheader" style="width: 248px; height: 200px;" title="">
                            <p style="font-size:14px">今天过生日的客户</p>
                            <p style="font-size:14px"></p>
                            <p style="font-size:25px ;" align="center">
                                <span style="color: red" id="bircount">
                                </span>位
                            </p>
                            <p style="font-size:14px" >
                                本月还有<span style="color: red" id="month">
                                </span>位会员过生日
                            </p>
                        </div></div>
                    </td>
                    <td>

                        <div class="panel panel-htop" style="display: block; width: 250px;"><div class="easyui-panel panel-body panel-body-noheader" style="width: 248px; height: 200px;" title="">
                            <p style="font-size:14px">会员总数</p>
                            <p style="font-size:25px ;" align="center">
                                <span style="color: red" id="totalMember">
                                </span>位
                            </p>
                            <p style="font-size:14px">平均每日新增
                                <span style="color: red">
                                    <i id="average">0.03</i>
                                </span>位会员
                            </p>
                        </div></div>
                    </td>
                    <td>
                        <div class="panel panel-htop" style="display: block; width: 250px;"><div class="easyui-panel panel-body panel-body-noheader" style="width: 248px; height: 200px;" title="">
                            <p style="font-size:14px">累计消费</p>
                            <p style="font-size:25px ;" align="center"><span style="color: red" id="totalExpense"></span>元</p>
                            <p style="font-size:14px">共<span style="color: red" id="totalCount"></span>
                                笔,平均每位会员消费<span style="color: red" id="averageExpense"></span>元</p>
                        </div></div>
                    </td>

                    <td><div class="easyui-panel panel-body panel-body-noheader" style="width: 248px; height: 200px;" title="">
                        <p style="font-size:25px ;" align="center">消费<span style="color: red"><i>TOP3</i></span>会员</p>
                        <table id="min_datagrid">

                        </table>
                    </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>

    <%--会员表格--%>
    <table id="member_datagrid">
    </table>


    <%--按钮--%>
    <div id="member_toolbar">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="add"/>新增</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true" data-cmd="edit" />编辑</a>
        <a class="easyui-linkbutton" iconCls="icon-remove" data-options="plain:true" data-cmd="remove" />删除</a>
        <shiro:hasPermission name="member:updatePassword">
            <a class="easyui-linkbutton" iconCls="icon-remove" data-options="plain:true" data-cmd="changePassword" />修改密码</a>
        </shiro:hasPermission>

        <%--高级查询--%>
        <!--多条件组合查询-->
        <input class="easyui-textbox" prompt="姓名/电话/卡号" id="keyword" />
       <%-- <input class="easyui-datebox" prompt="入职日期" id="hireDate"/>--%>
        <a class="easyui-linkbutton" iconCls="icon-mysearch" plain="true"  data-cmd="query">查询</a>
        <%--导入导出的按钮--%>
        <a class="easyui-linkbutton" iconCls="icon-emoji2" data-options="plain:true" onclick="window.open('/member/exportXls.do')">导出</a>
        <%--上传表单--%>
        <form method="post" enctype="multipart/form-data" action="/member/importXls.do">
            <input type="file" name="file"/>
            <input type="submit" value="导入"/>
        </form>
    </div>
    <%--表单按钮--%>
    <div id="btn">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="saved"/>保存</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true"  data-cmd="cancel">取消</a>
    </div>
    <div id="passwordbtn">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="savePassword"/>保存</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true"  data-cmd="cancel">取消</a>
    </div>



    <%--弹出窗口--%>
    <div id="member_dialog" class="easyui-dialog" data-options="title:'编辑',iconCls:'icon-myedit',closed:true">
        <!--创建表单-->
        <form id="member_form" method="post">
            <table align="center" style="margin-top:15px">
                <input type="hidden" name="id" id="memberId"/>
                <tr>
                    <td align="center">会员卡号:</td>
                    <td><input name="cardNumber" class="easyui-textbox"  prompt="请输入卡号"
                               invalidMessage="卡号已经存在"
                               validType="remote['/member/validate.do?id='+memberId.value,'cardNumber']"/>
                     </td>
                </tr>
                <tr>
                    <td align="center">姓名:</td>
                    <td><input name="name" class="easyui-textbox"  prompt="请输入姓名" iconCls="icon-man"/></td>
                </tr>
                <tr>
                    <td align="center">电话:</td>
                    <td><input name="tel" class="easyui-textbox" prompt="请输入电话" /></td>
                </tr>
                <tr>
                    <td align="center">会员生日:</td>
                    <td><input name="birthday" class= "easyui-datebox" /></td>
                </tr>
                <tr id="psw">
                    <td align="center">密码:</td>
                    <td><input name="password" type="password" class="easyui-textbox"/></td>
                </tr>
                <tr>
                    <td align="center">会员等级:</td>
                    <td><input name="levelName" class="easyui-combobox"
                               data-options="panelHeight:'auto',textField:'name',valueField:'name',url:'/dictionary/listAllDetail.do?dictionaryId=1'"/></td>
                </tr>
                <tr>
                    <td align="center">会员分组:</td>
                    <td><input name="groupName" class="easyui-combobox" prompt="请选择客户等级"
                               data-options="panelHeight:'auto',textField:'name',valueField:'name',url:'/dictionary/listAllDetail.do?dictionaryId=4' "/></td>
                </tr>
                <tr>
                    <td align="center">店铺:</td>
                    <td><input name="shopName" class="easyui-combobox" prompt="店铺名称"
                               data-options="panelHeight:'auto',textField:'name',valueField:'name',url:'/shop/listAll.do' "/></td>
                </tr>
                <tr>
                    <td align="center">开卡员工:</td>
                    <td><input name="employeeName" class="easyui-combobox" iconCls="icon-man"
                               data-options="panelHeight:'auto',textField:'username',valueField:'username',url:'/employee/selectAll.do'"/></td>
                </tr>
                <tr>
                    <td align="center">开卡金额:</td>
                    <td><input name="balance" class="easyui-textbox"/></td>
                </tr>
                <tr>
                    <td align="center">地址:</td>
                    <td><input name="address" class= "easyui-textbox" prompt="客户地址"/></td>
                </tr>
                <tr>
                    <td align="center">客户来源:</td>
                    <td><input name="sourceName" class="easyui-combobox"
                               data-options="panelHeight:'auto',textField:'name',valueField:'name',url:'/dictionary/listAllDetail.do?dictionaryId=5' "/></td>
                </tr>

            </table>
        </form>
    </div>

<%--修改密码窗口--%>
    <div id="memberPassword_dialog" class="easyui-dialog" data-options="title:'编辑',iconCls:'icon-myedit',closed:true">
        <!--创建表单-->
        <form id="password_form" method="post">
            <table align="center" style="margin-top:15px">
                <input type="hidden" name="id"/>
                <tr>
                    <td align="center">新密码:</td>
                    <td><input name="password" class= "easyui-textbox" prompt="请输入密码"/></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>
